﻿using HPIT_Library_Modal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HPIT_Library
{
    public partial class inventory2 : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindBookList();
        }
        public void BindBookList()
        {
            string bookname = TextBox1.Text.Trim();
            string bookautor = TextBox2.Text.Trim();
            BooksSerichModel serichModel = new BooksSerichModel() { 
                BookName=bookname,
                BookAuthor=bookautor
            };
            int totalCount = 0;
            List<Books> list=  HPIT_Library_BLL.bookManger.GetBooksPageList(serichModel, AspNetPager.CurrentPageIndex, AspNetPager.PageSize, ref totalCount);
            AspNetPager.RecordCount = totalCount;

            Repeater1.DataSource = list;
            Repeater1.DataBind();

        }

        protected void AspNetPager_PageChanged(object sender, EventArgs e)
        {
            BindBookList();
        }
    }
}